package utils

import (
    "github.com/beego/beego/v2/core/logs"
)

func InitLogger(logFile string) error {
    config := fmt.Sprintf(`{"filename":"%s","level":7}`, logFile)
    err := logs.SetLogger(logs.AdapterFile, config)
    if err != nil {
        return err
    }
    logs.EnableFuncCallDepth(true)
    logs.SetLogFuncCallDepth(3)
    return nil
}
